import request from '@/utils/request'

export function setUserId(id,roleId) {
  return request({
    url: '/user/setUserId/'+id+'/'+roleId,
    method: 'put',
  })
}
export function getRoleIdByuserId(userId) {
  return request({
    url: '/user/getRoleIdByuserId/'+userId,
    method: 'get',
  })
}
export function getAllAuth() {
  return request({
    url: '/user/getAllAuth',
    method: 'get',
  })
}


export function lockUser(id,statue) {
  return request({
    url: '/user/lockUserSet/'+id+'/'+statue,
    method: 'put',
  })
}

export function getUserList(params) {
  return request({
    url: '/user/list',
    method: 'get',
    params,
    timeout: 10000,
    // headers: {
    //   'X-Requested-With':'XMLHttpRequest'
    // }
  })
}
export function updateUser(data) {
    return request({
      url: '/user/update',
        method: 'post',
        data
    })
}
export function addUser(data) {
    return request({
      url: '/user/add',
      method: 'post',
      data
    })
  } 
export function deluser(params) {
    return request({
      url: '/user/'+params,
      method: 'delete',
    })
  }
